suite('App', function() {
  test('Should be present', function() {
    assert.ok(window.baker211b);
  });
});

suite('Lists', function() {
  //立即执行
  // var spy = sinon.spy(WB2, 'anyWhere');

  test('Reading a list', function() {
    //mocha.run()之后
    //assert.equal(2, spy.callCount);
  })

  test('Creating a list', function() {
    // TODO: Do the DOM stuff for creating a list
    var $el = baker211b.views.app.$el;
    var listName = 'Example list';

    // Show the add list form
    $el.find('#add-list-button').click();

    // Fill out a value for the new list's title
    $el.find('#list_title').val(listName);
    $el.find('#list_title').parents('form').first().submit();

    // Make sure the spy has seen a call for a list being created
    // assert.equal(3, spy.callCount);

    // Ensure the expected UI element has been added
    assert.equal(listName, $('.list-menu-item:first').text().trim());
  });

  // test('Editing a list', function() {
  //   // TODO: Do the DOM stuff for editing a list
  //   assert.equal(1, spy.callCount);
  // });

  // // Example: Abstraction for testing
  // test('Deleting a list', function() {
  //   // TODO: Do the DOM stuff for deleting a list
  // });
});